package com.feng;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @description:
 * @author: lrf
 * @create: 2019-09-03
 **/
public class Main {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext context
                = new AnnotationConfigApplicationContext();


        context.getEnvironment().setActiveProfiles("prod");

        context.register(ProfileConfig.class);

        context.refresh(); // 必须刷新

        DemoBean demoBean = context.getBean(DemoBean.class);

        System.out.println(demoBean.getContext());

        context.close();
    }
}
